"""Module contains classes that describe the type of contents in a map"""

class SquareType:
    """Base square type class"""
    __is_solid = True
    __is_transparent = True
    __character = " "

    @property
    def is_solid(self):
        """Is the square solid and cannot be walked on?"""
        return self.__is_solid

    @is_solid.setter
    def is_solid(self, value):
        self.__is_solid = value

    @property
    def is_transparent(self):
        """Can light pass through this square?"""
        return self.__is_transparent

    @is_transparent.setter
    def is_transparent(self, value):
        self.__is_transparent = value

    @property
    def character(self):
        """The ASCII character used to represent the square"""
        return self.__character

    @character.setter
    def character(self, value):
        self.__character = value

    def __str__(self):
        return self.character


class Void(SquareType):
    """The empty void of space."""
    def __init__(self):
        self.is_solid= True
        self.is_transparent = True
        self.character = " "


class Wall(SquareType):
    """Wall square"""
    __is_left_wall = False
    __is_right_wall = False
    __is_top_wall = False
    __is_bottom_wall = False

    def __init__(self, is_left_wall, is_right_wall, is_top_wall, is_bottom_wall):        
        """
        Create a wall square by defining its facing. Walls that have two (e.g. left and top) are corner walls
        """
        self.is_solid= True
        self.is_transparent = False
        self.__is_left_wall = is_left_wall
        self.__is_right_wall = is_right_wall 
        self.__is_top_wall = is_top_wall 
        self.__is_bottom_wall = is_bottom_wall 
    
    @property
    def character(self):        
        if self.__is_left_wall and self.__is_top_wall:
            return "+" #chr(201)
        elif self.__is_right_wall and self.__is_top_wall:
            return "+" #chr(187)
        elif self.__is_left_wall and self.__is_bottom_wall:
            return "+" #chr(200)
        elif self.__is_right_wall and self.__is_bottom_wall:
            return "+" #chr(188)
        elif self.__is_right_wall or self.__is_left_wall:
            return "|" #chr(186)
        elif self.__is_top_wall or self.__is_bottom_wall:
            return "-" #chr(205)
      
    
class EmptyFloor(SquareType):
    """Empty floor square"""
    def __init__(self):
        self.is_solid = False
        self.is_transparent = True
        self.character = "."

